package de.rwthaachen.wzl.gt.user.trn.calc;

import de.rwthaachen.wzl.gt.tools.calc.CalculatorFunction;
import de.rwthaachen.wzl.gt.tools.calc.gui.CalculatorConstraints;

public class Potenzrechnung implements CalculatorFunction {
	
	private Number zahl1;
	private Number zahl2;

	public Number getResult() {
		double result = Math.pow(zahl1.doubleValue(), zahl2.doubleValue());
		return new Double(result);
	}

	public String getSection() {
		return CalculatorConstraints.PANEL_FUCTIONS;
	}

	public String getTextResult() {
		return null;
	}

	public String getTitle() {
		return "^";
	}

	public boolean isUnary() {
		return false;
	}

	public void setOperand(Number op) {
		if(zahl1==null)
			zahl1 = op;
		else
			zahl2 = op;
	}
}